#ifndef	__CREATE_WINDOW_H
#define	__CREATE_WINDOW_H

#include <gtk/gtk.h>

static GtkWidget *window;

void create_window(void)
{	
	GtkWidget *label = NULL;
	GtkWidget *table = NULL;
	GtkWidget *button = NULL;
	GtkWidget *text = NULL;
	GtkWidget *combo = NULL;
	GList *glist = NULL; 

	window = g_object_new(GTK_TYPE_WINDOW, 
				"title", "configration", 
				"default_height", 300,
				"default_width", 300,
				NULL);
	gtk_container_border_width(GTK_CONTAINER(window), 10);

	table = gtk_table_new(12, 3, FALSE);
	gtk_table_set_row_spacings(GTK_TABLE(table), 5);
	gtk_table_set_col_spacings(GTK_TABLE(table), 5);

	gtk_container_add(GTK_CONTAINER(window),table);
	label = gtk_label_new("并行系统");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);

	label = gtk_label_new("发射预警数据配置");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);

	label = gtk_label_new("参数: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("数值: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 1, 2, 2, 3);
	gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0);

	label = gtk_label_new("单位: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 2, 3);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("半径: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("反照率: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 4, 5);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("速度: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 5, 6);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("预报期: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 6, 7);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("距离阈值: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 7, 8);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("时间阈值: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 8, 9);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("位置: ");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 9, 10);
	gtk_misc_set_alignment(GTK_MISC(label), 1, 0);

	label = gtk_label_new("m");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 3, 4);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("%");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 4, 5);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("km/s");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 5, 6);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("day");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 6, 7);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("km");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 7, 8);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("s");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 8, 9);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	label = gtk_label_new("km");
	gtk_table_attach_defaults(GTK_TABLE(table), label, 2, 3, 9, 10);
	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);

	button = gtk_button_new_with_label("上一页");
	gtk_table_attach_defaults(GTK_TABLE(table), button, 0, 1, 10, 11); 
	button = gtk_button_new_with_label("下一页");
	gtk_table_attach_defaults(GTK_TABLE(table), button, 1, 2, 10, 11); 
	button = gtk_button_new_with_label("保存");
	gtk_table_attach_defaults(GTK_TABLE(table), button, 2, 3, 10, 11); 

	text = gtk_entry_new();
	gtk_table_attach_defaults(GTK_TABLE(table), text, 1, 2, 3, 4); 
	text = gtk_entry_new();
	gtk_table_attach_defaults(GTK_TABLE(table), text, 1, 2, 4, 5); 

	combo = gtk_combo_new();
	gtk_table_attach_defaults(GTK_TABLE(table), combo, 1, 2, 5, 6);  
    	glist = g_list_append (glist, "String 1");
    	glist = g_list_append (glist, "String 2");
    	glist = g_list_append (glist, "String 3");
    	glist = g_list_append (glist, "String 4");
    	gtk_combo_set_popdown_strings (GTK_COMBO(combo), glist); 
	gtk_combo_set_use_arrows_always(GTK_COMBO(combo), FALSE);

	text = gtk_entry_new();
	gtk_table_attach_defaults(GTK_TABLE(table), text, 1, 2, 6, 7); 
	text = gtk_entry_new();
	gtk_table_attach_defaults(GTK_TABLE(table), text, 1, 2, 7, 8); 
	text = gtk_entry_new();
	gtk_table_attach_defaults(GTK_TABLE(table), text, 1, 2, 8, 9); 

	combo = gtk_combo_new();
	gtk_table_attach_defaults(GTK_TABLE(table), combo, 1, 2, 9, 10);  
    	glist = g_list_append (glist, "String 1");
    	glist = g_list_append (glist, "String 2");
    	glist = g_list_append (glist, "String 3");
    	glist = g_list_append (glist, "String 4");
    	gtk_combo_set_popdown_strings (GTK_COMBO (combo), glist); 
	gtk_combo_set_use_arrows_always(GTK_COMBO(combo), FALSE);
	return ;
}

#endif
